<?php

Route::post('upload','UploadController@upload')->name('api.upload.img');//上传图片
Route::post('upload/file','UploadController@file')->name('api.upload.file');//上传文件

Route::group(['namespace' => 'Admin'], function () {

    Route::post('login','AuthController@login');//登录
    Route::post('logout','AuthController@logout');//退出
    Route::get ('captcha','AuthController@captcha');//验证码
    Route::get ('download','AuthController@download');//下载

    Route::group(['middleware' => 'auth:api'], function(){
        //管理员
        Route::group(['prefix' => 'manager'], function(){
            Route::get ('/','ManagerController@index');//列表
            Route::post('/update', 'ManagerController@update');//更新
            Route::post('/destroy', 'ManagerController@destroy');//删除
            Route::post('/lock', 'ManagerController@lock');//锁定
            Route::post('/unlock', 'ManagerController@unlock');//启用
        });
        //配置
        Route::group(['prefix' => 'config'], function(){
            Route::get ('/','ConfigController@index');//列表
            Route::post('/update', 'ConfigController@update');//更新
        });
        //分类
        Route::group(['prefix' => 'cate'], function(){
            Route::get ('/','CateController@index');//列表
            Route::get ('/all','CateController@all');//所有
            Route::post('/update', 'CateController@update');//更新
            Route::post('/destroy', 'CateController@destroy');//删除
        });
        //标签
        Route::group(['prefix' => 'tag'], function(){
            Route::get ('/','TagController@index');//列表
            Route::post('/update', 'TagController@update');//更新
            Route::post('/destroy', 'TagController@destroy');//删除
        });
        //新闻
        Route::group(['prefix' => 'new'], function(){
            Route::get ('/','NewController@index');//列表
            Route::get ('/all','NewController@all');//所有
            Route::get ('/info','NewController@info');//详情
            Route::post('/update', 'NewController@update');//更新
            Route::post('/destroy', 'NewController@destroy');//删除
            Route::post('/agree', 'NewController@agree');//通过
            Route::post('/refuse', 'NewController@refuse');//不通过
        });
        //SEO
        Route::group(['prefix' => 'seo'], function(){
            Route::get ('/','SeoController@index');//列表
            Route::post('/update', 'SeoController@update');//更新
            Route::post('/destroy', 'SeoController@destroy');//删除
        });
        //友情链接
        Route::group(['prefix' => 'friend'], function(){
            Route::get ('/','FriendController@index');//列表
            Route::post('/update', 'FriendController@update');//更新
            Route::post('/destroy', 'FriendController@destroy');//删除
        });
        //导航
        Route::group(['prefix' => 'chanel'], function(){
            Route::get ('/','ChanelController@index');//列表
            Route::post('/update', 'ChanelController@update');//更新
            Route::post('/destroy', 'ChanelController@destroy');//删除
        });
        //快讯
        Route::group(['prefix' => 'live'], function(){
            Route::get ('/','LiveController@index');//列表
            Route::post('/update', 'LiveController@update');//更新
            Route::post('/destroy', 'LiveController@destroy');//删除
        });
        //项目
        Route::group(['prefix' => 'project'], function(){
            Route::get ('/','ProjectController@index');//列表
            Route::get ('/all','ProjectController@all');//所有
            Route::get ('/info','ProjectController@info');//详情
            Route::post('/update', 'ProjectController@update');//更新
            Route::post('/destroy', 'ProjectController@destroy');//删除
        });
        //学院
        Route::group(['prefix' => 'college'], function(){
            Route::get ('/','CollegeController@index');//列表
            Route::get ('/info','CollegeController@info');//详情
            Route::post('/update', 'CollegeController@update');//更新
            Route::post('/destroy', 'CollegeController@destroy');//删除
        });

        //单页
        Route::group(['prefix' => 'page'], function(){
            Route::get ('/','PageController@index');//列表
            Route::get ('/info','PageController@info');//详情
            Route::post('/update', 'PageController@update');//更新
            Route::post('/destroy', 'PageController@destroy');//删除
        });

        //会员管理
        Route::group(['prefix' => 'user'], function(){
            Route::get ('/','UserController@index');//列表
            Route::post('/update', 'UserController@update');//更新
            Route::post('/destroy', 'UserController@destroy');//删除
            Route::get ('/column','UserController@column');//专栏
            Route::post('/verify', 'UserController@verify');//审核
            Route::post('/refuse', 'UserController@refuse');//取消
            Route::get('/column/all', 'UserController@columnAll');//所有专栏人员
        });
    });
});